@extends('layout.index')
@section('title', '后台商品添加')
@section('content')
 <div class="mws-panel grid_8">
	
    <div class="mws-panel-body no-padding">
    	<form action="/admin/goods/insert" method='post' class="mws-form " enctype="multipart/form-data">
    	@if (count($errors) >0)
    		<div class='mws-form-message error'>
    			添加失败!
    			<ul>
    				@foreach ($errors->all() as $error)
						<li>{{$error}}</li>
					@endforeach

    			</ul>
    		</div>

    	@endif
    		<div class="mws-panel grid_8">
                    <div class="mws-panel-header">
                        <span>商品添加</span>
                    </div>
                    <div class="mws-panel-body no-padding">
                        <form action="form_layouts.html" class="mws-form">
                            <div class="mws-form-inline">
                                <div class="mws-form-row">
                                    <label class="mws-form-label">商品名</label>
                                    <div class="mws-form-item">
                                        <input type="text" class="smallinfo" name='proname'>
                                    </div>
                                </div>
                                
                            
                                
                                <div class="mws-form-row">
                                    <label class="mws-form-label">商品状态</label>
                                    <div class="mws-form-item">
                                        <select class="smallinfo" name='state'>
                                            <option value ="0">热销</option>
                                            <option value ="1">首发</option>
                                            <option value ="2">下架</option>
                                            <option value ="3">缺货</option>
                                            <option value ="4">有货</option>
                                            
                                        </select>
                                    </div>
                                </div>
                               

                                 <div class="mws-form-row">
                                    <label class="mws-form-label">商品专区</label>
                                    <div class="mws-form-item">
                                        <select class="smallinfo" name='zome'>
                                            <option value ="0">小米手机</option>
                                            <option value ="1">红米手机</option>
                                            <option value ="2">小米平板</option>
                                            <option value ="3">小米电视</option>
                                            <option value ="4">硬件专区</option>
                                            <option value ="5">配件专区</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="mws-form-row">
                                    <label class="mws-form-label">商品类别</label>
                                    <div class="mws-form-item">
                                        <select class="smallinfo" name="cateid">
                                        @foreach($cates as $k=>$v) 
                                            <option value ="{{$v->id}}">{{$v->catename}}</option>
                                         @endforeach  
                                        </select>
                                    </div>
                                </div>
                                <div class="mws-form-row">
                                        <label class="mws-form-label">商品图片:</label>
                                        <div class="mws-form-item">
                                            <div style="position: relative;" class="fileinput-holder">
                                            
                                                <input name= "image" type="file">
                                                
                                            </div>
                                        </div>
                                </div>
                               
                            <div class="mws-form-row"> 
                            <label class="mws-form-label">商品描述:</label> 
                            <br> 
                            <br> 
                            <br> 
                           
                                <script  name ='des' id="editor" type="text/plain" style="width:950px;height:300px;"></script>
                            </div>

                             
                            {{csrf_field()}}
                            <div class="mws-button-row">
                                <input type="submit" class="btn btn-danger" value="Submit">
                                <input type="reset" class="btn " value="Reset">
                            </div>
                        </form>
                    </div>      
                </div>
                <script type="text/javascript">
                var ue = UE.getEditor('editor');
                </script>
@endsection



